<%@ page import="weaver.general.Util" %>
<%@ page import="com.alibaba.fastjson.JSONObject" %>
<%@ page import="weaver.conn.RecordSet" %>
<%@ page import="com.alibaba.fastjson.JSONArray" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%
    //通过合同编号获取获取所有的剩余可支付金额
    JSONObject res = new JSONObject();
    String wybs = Util.null2String(request.getParameter("wybs"));
    if ("".equals(wybs)) {
        res.put("api_status", false);
        res.put("message", "唯一标识为空");
        out.print(res.toString());
        out.flush();
        return;
    }
    String[] split = wybs.split(",");
    StringBuffer sb = new StringBuffer();
    for (int i = 0; i < split.length; i++) {
        sb.append("'").append(split[i]).append("'").append(",");
    }
    String instr = "";
    if (sb.toString().endsWith(",")) {
        instr = sb.toString().substring(0, sb.length() - 1);
    }
    JSONArray jsonArray = new JSONArray();
    if (!instr.equals("")) {
        RecordSet rs = new RecordSet();
        rs.executeQuery("select wybs,sykzf from ficoyfkxq where wybs in  (" + instr + ")");
        while (rs.next()){
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("wybs",rs.getString("wybs"));
            jsonObject.put("sykzf",rs.getString("sykzf"));
            jsonArray.add(jsonObject);
        }
    }
    res.put("api_status", true);
    res.put("data", jsonArray);
    out.print(res.toString());
    out.flush();

%>